// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

db=cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
  
    let result='fail'
  //----------------------更新设置表
  let addNewSettings = await db.collection('settings').doc('W6H8EO9Ghf6stBZy').update({
    data: event.settings
  }).then(res=>{
    result='success'
  })
  return {
    result: result
  }
}